
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui">

    <div class="post">

        <h2 class="title">Relação de Usuarios</h2>

        <h:panelGroup id="painelMensagens" layout="block">
            <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
        </h:panelGroup>


    </div>
    <p>
    <h:form id="form2">

        <p:dataTable var="userAux" value="#{UserController.useres}" emptyMessage="Nenhum Usuário Encontrado">
            <p:column sortBy="#{userAux.id}">
                <f:facet name="header">
                    <h:outputText value="Número" />
                </f:facet>
                <h:commandLink action="#{UserController.edit}" value="#{userAux.id}" />
            </p:column>

            <p:column sortBy="#{userAux.nome}">
                <f:facet name="header">
                    <h:outputText value="Nome" />
                </f:facet>
                <h:outputText value="#{userAux.nome}" />
            </p:column>

            <p:column sortBy="#{userAux.login}">
                <f:facet name="header">
                    <h:outputText value="Login" />
                </f:facet>
                <h:outputText value="#{userAux.login}" />
            </p:column>

            <p:column sortBy="#{userAux.email}">
                <f:facet name="header">
                    <h:outputText value="E-mail" />
                </f:facet>
                <h:outputText value="#{userAux.email}" />
            </p:column>

            <p:column>
                <f:facet name="header">
                    <h:outputText value="Situação" />
                </f:facet>
                <h:outputText value="Ativo" rendered="#{userAux.ativo}" />
                <h:outputText value="Inativo" rendered="#{!userAux.ativo}" />
            </p:column>
            <p:column>
                <f:facet name="header">
                    <h:outputText value="Editar" />
                </f:facet>
                <h:commandLink action="#{UserController.edit}" value="Editar"  />
            </p:column>

        </p:dataTable>
    </h:form>
</p>
</html>
